#pragma once
#include <game/Config.h>

#include <Config.h>
#include <string>
#include <memory>
#include <game/DebugInfoManager.h>

namespace liba {
namespace lib3d {
namespace node {
class Camera;
class Node;
} // namespace node
namespace hard {
	class Hardware;
} // namespace hard
} // namespace lib3d
class Atom;
} // namespace liba

ARELLO_GAME_NAMESPACE_DECL_START
namespace controls {
class ControlCollection;
} // namespace controls

class ScreenImpl;
class ScreenBackend;
class Properties;
class Root;

class Screen
{
public:
	Screen(Root& root);
	virtual ~Screen();
	// Main components of scene are camera and root object

	void SetRootNode(std::auto_ptr<liba::lib3d::node::Node> value);
	void SetMainCamera(std::auto_ptr<liba::lib3d::node::Camera> value);
	void SetProperties(std::auto_ptr<Properties> value);
	
	void Activate();
	void Deactivate();

	controls::ControlCollection* GetControls();

	/** Attaches backend to this screen. Transfers backend ownership */
	void AttachBackend(std::auto_ptr<ScreenBackend> value);

	virtual const Properties* GetProperty() const;

	bool LifeCycle(time_float dt);	
	void render(liba::lib3d::hard::Hardware* hardware, DebugInfoManager* value);
private:
	std::auto_ptr<ScreenImpl> impl;
};

ARELLO_GAME_NAMESPACE_DECL_END